/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sv.org.auditoria.renta.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author HP
 */
@Entity
@Table(name = "RANGOS", catalog = "", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Rangos.findAll", query = "SELECT r FROM Rangos r"),
    @NamedQuery(name = "Rangos.findByIdrango", query = "SELECT r FROM Rangos r WHERE r.idrango = :idrango"),
    @NamedQuery(name = "Rangos.findByMontominimo", query = "SELECT r FROM Rangos r WHERE r.montominimo = :montominimo"),
    @NamedQuery(name = "Rangos.findByPagobase", query = "SELECT r FROM Rangos r WHERE r.pagobase = :pagobase"),
    @NamedQuery(name = "Rangos.findByPorcentajepago", query = "SELECT r FROM Rangos r WHERE r.porcentajepago = :porcentajepago")})
public class Rangos implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "IDRANGO")
    private BigDecimal idrango;
    @Column(name = "MONTOMINIMO")
    private BigInteger montominimo;
    @Column(name = "PAGOBASE")
    private BigInteger pagobase;
    @Column(name = "PORCENTAJEPAGO")
    private BigInteger porcentajepago;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "rangosIdrango")
    private List<Declaraciones> declaracionesList;

    public Rangos() {
    }

    public Rangos(BigDecimal idrango) {
        this.idrango = idrango;
    }

    public BigDecimal getIdrango() {
        return idrango;
    }

    public void setIdrango(BigDecimal idrango) {
        this.idrango = idrango;
    }

    public BigInteger getMontominimo() {
        return montominimo;
    }

    public void setMontominimo(BigInteger montominimo) {
        this.montominimo = montominimo;
    }

    public BigInteger getPagobase() {
        return pagobase;
    }

    public void setPagobase(BigInteger pagobase) {
        this.pagobase = pagobase;
    }

    public BigInteger getPorcentajepago() {
        return porcentajepago;
    }

    public void setPorcentajepago(BigInteger porcentajepago) {
        this.porcentajepago = porcentajepago;
    }

    @XmlTransient
    public List<Declaraciones> getDeclaracionesList() {
        return declaracionesList;
    }

    public void setDeclaracionesList(List<Declaraciones> declaracionesList) {
        this.declaracionesList = declaracionesList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idrango != null ? idrango.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Rangos)) {
            return false;
        }
        Rangos other = (Rangos) object;
        if ((this.idrango == null && other.idrango != null) || (this.idrango != null && !this.idrango.equals(other.idrango))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "sv.org.auditoria.renta.entity.Rangos[ idrango=" + idrango + " ]";
    }
    
}
